package com.teemo.dp.singleton.demo10;

/**
 * @author Teemo
 */
public class Washer implements Cloneable{
    private Washer() {
        System.out.println("Washer is created");
    }

    private static final Washer washer = new Washer();

    public static Washer getInstance() {
        return washer;
    }
    public void wash() {
        System.out.println("washing...");
    }

    @Override
    protected Object clone() throws CloneNotSupportedException {
        return washer;
    }
}
